package com.hhs.storage.controller;


import com.hhs.storage.bean.InputParam;
import com.hhs.storage.bean.UserFollowGroup;
import com.hhs.storage.service.UserFollowGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hhs
 * @since 2023-04-19
 */
@RestController
@RequestMapping("/userFollowGroup")
public class UserFollowGroupController {
    @Resource
    private UserFollowGroupService userFollowGroupService;

    /**
     *查询所有关注分组
     * @return
     */
    @RequestMapping("/getAll")
    public Map getAll(InputParam inputParam){
        return userFollowGroupService.getAll(inputParam);
    }

    /**
     * 编辑
     * @param userFollowGroup
     * @return
     */
    @RequestMapping("/edit")
    public Map edit(UserFollowGroup userFollowGroup,String followUserIds){
        return userFollowGroupService.edit(userFollowGroup,followUserIds);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @RequestMapping("/delete")
    public Map delete(@RequestParam String id){
        return userFollowGroupService.delete(id);
    }

    @RequestMapping("/getAllAndMembers")
    public Map getAllAndMembers(InputParam inputParam){
        return userFollowGroupService.getAllAndMembers(inputParam);
    }

}

